package com.me.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class MyErrorViewResolver implements ErrorController {
	private static final String ERROR_PAGE = "notFound";

	@GetMapping("/error")
	public ModelAndView resolveErrorView(HttpServletRequest request, HttpStatus status, Map<String, Object> model) {
		// TODO Auto-generated method stub
		ModelAndView modelAndView = new ModelAndView(ERROR_PAGE);

		return modelAndView;
	}

	@Override
	public String getErrorPath() {
		// TODO Auto-generated method stub
		return "/hello";
	}

}
